home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Network Support Library
/
RoseWare - Network Support Library.iso
/
logbatch
/
say2.exe
/
SAYINGS.DOC
< prev
next >
Wrap
Text File
|
1991-08-26
|
9KB
|
181 lines
SAYINGS is a *free* program that displays a "message for the day" on your
screen. It gets its "sayings" from an easily-modified text file called
SAYINGS.DAT, so if you have your own quotes that you'd like to add to the
file, you can do so with any text editor. Message displays may be in
a color window that disappears when you press a key, or just dumped on
your screen (preferred mode for your AUTOEXEC.BAT file, so you don't have
to press a key, and you'll have something to read while all that stuff
loads!).
>-
>- Using SAYINGS
>-
The sayings program is easy to use, just type SAYINGS at the DOS prompt
and it will select a quote from the SAYINGS.DAT file and display it on
your screen in a color window in the center of your screen. You can add
your own quotes (see 'The SAYINGS.DAT File'), or even keep separate data
files for each user on your network. Sayings normally looks for its
data in the same directory that it resides in, but you can keep it anywhere
you like. Let's talk about some of the options you can use with SAYINGS.
>-
>- Command-Line Options
>-
The /? Option: Help Screen
If you need a quick display of all of the command-line options for SAYINGS,
use the /? or -? option (you can use a / or - with any of the options). In
other words, just type SAYINGS /?.
The /C# Option: Selecting Colors
The default mode for SAYINGS is window mode. There are seven colorsets
that can be selected for the window colors by using the /C# option, where
# is a number from 1 to 7. Try them all and select one that pleases you.
If you have a monochrome monitor, try number 7.
The /T Option: Text mode
If you don't like the windows, or you want to display a saying without
requiring a keypress to continue processing, use text mode. If you type
SAYINGS /T, you'll get a flat ascii dump of a message on your screen, and
it won't wait for you to press a key. This is most handy in batch files;
I have several (including my AUTOEXEC file) that display a message in text
mode and then continue with several other tasks that take a while to execute.
Using a Different Data File
You can use SAYINGS with any file that contains a list of quotes that it
understands; it doesn't have to be called SAYINGS.DAT, and it doesn't have
to reside in the same directory as SAYINGS.EXE. Just give SAYINGS a path
specification for the file that you want to use, and it will attempt to
read that file and select a saying from it. If the file can't be found,
you'll get an error message.
The ability to keep SAYINGS.EXE and SAYINGS.DAT in separate directories
is handy on networks. You can keep the EXE file in a protected area, and
the DAT file someplace where everyone can add their own. Better yet, you
can have one in each user's home directory. If you have an environment
variable called USR set to the user's login name (as most networks do),
just run SAYINGS in the login script as SAYINGS F:\USERS\%usr%\SAYINGS.DAT
or SAYINGS F:\COMMON\%usr%.DAT.
>-
>- The SAYINGS.DAT File
>-
Adding your own sayings to the "database" is easy. Open SAYINGS.DAT
with your favorite text editor, and you'll quickly see how it works.
Each line in the file is one complete "saying", and sayings can span
multiple lines by separating them with a '|' character. For instance,
this line:
Fact:||Red lights always last|longer than green ones.
will appear as a 4 line message on the screen (there's a blank line
after "Fact:"). If I didn't explain that clearly enough, just open up
SAYINGS.DAT and take a look, I'm sure it'll be pretty apparent to you.
A few notes about the SAYINGS.DAT file follow. You may have noticed
that the sayings I gave you (over 850 of them!) are in sorted order.
There's no reason for that other than my own cravings for neatness; the
sayings may be listed in any order. Keep in mind that longer sayings
have a greater chance of being selected than shorter ones, so you may
want to refrain from adding quotes that are several paragraphs long.
Also, make sure that each line in the saying are short enough to fit
on your screen. If you have an 80-column screen and you add a saying
that's 90 columns long, SAYINGS will give you an error message when it
tries to display that particular message in a window (see the section
on SAYCHK to check for oversized messages!) or, if you're running in
text mode, it will wrap around on the screen. Just add a '|' somewhere
in the middle to break it into two lines, and you'll be fine!
As you're adding your sayings you may want to see them to make sure
that they're centered properly, or whatever. Here's a little trick:
just put your saying into a file all by itself, and then tell SAYINGS
to use that file as its data file. If you've put it in a file called
MINE, type SAYINGS MINE.
>-
>- The SAYCHK Utility
>-
In the early days of SAYINGS, users would get a "Message too long" error
occasionally, but no indication of which message was too long to fit in
a window or where it was in the file. The SAYCHK utility will search
through your entire SAYINGS.DAT file looking for messages that won't fit
in a window on your screen. When it finds one, it tells you what line
number it is on, and prints a copy of that message on your screen. That
way, you can ensure that you (or anyone else) will never be disappointed
by a "Message too long" error.
If you just run SAYCHK, it will look for SAYINGS.DAT in the current
directory. If you want to check any other file you have to specify a
path to that file. For instance, you can run SAYCHK D:\QUIPS.TXT.
The important part to remember is that SAYCHK only checks that the sayings
can be displayed on the _current_ video screen. So if you're in 132 column
mode and you run SAYCHK, it will assure you that none of the sayings are
too long to be displayed on a 132 column screen. But if you switch to
80 column mode later, you could still encounter a message that is too long
for your screen. The best idea is to switch to the smallest screen that
you'll ever use before you run SAYCHK. For most people, this discussion is
irrelevant; most displays are 80 columns by 25 lines, so just run SAYCHK
once after you've added your new sayings and forget about it.
If you need it, SAYCHK also has a help screen that can be viewed with the
/? option.
>-
>- Why FreeWare?
>-
This program is provided to you as freeware, mostly because I'm tired of
seeing people trying to make money off of trivial programs, *especially*
the ones that display obnoxious messages with lots of long beeps telling
you that you should send all your money to someone who just figured out
how to use their compiler. This program is at least as good as any other
similar package out there, features easily customized messages, and it's
free! Shareware is a great concept; let's not ruin it with greed.
This program carries no warranty of any kind, use it at your own risk; the
author will not be held responsible for any damages to your system caused
by use of the program, though it would be truly interesting to hear how
someone could possibly hurt themselves with something as harmless as
this. No upgrades or revisions to this program are planned, but more
unlikely accidents have happened in the past. If you have comments,
suggestions, insults, bug reports, or whatever drop me a line by either
US Mail or CompuServe eMail (please don't phone). If you send a disk,
a self-addressed stamped envelope, and maybe a neighborly letter I'll
send you even more free goodies that I've cooked up over the years!
Scott Wertz CompuServe 71541,3051
9740 Michael Drive
Streetsboro, OH 44241
>-
>- Version Release Information
>-
SAYINGS Version 1.0 Initial Release. Displays sayings in a color window
of variable size. Posted on CompuServe IBMNEW forum.
This version also appeared in "Stupid PC Tricks" by
Bob LeVitus and Ed Tittel, Addison Wesley Publishing
Company (c)1991. ISBN 0-201-57759-3. Thanx Ed!
Version 1.1 Added ability to specify a data file other than
SAYINGS.DAT, possibly in a different directory.
Version 1.2 Replaced the random number generator - some sayings
were never being displayed!
Version 2.0 Complete rewrite.
Ported from Microsoft C to Borland C.
Rewrote window-drawing routines, added colorsets.
Replaced random number generator again, better than ever.
Added /TEXT option to bypass windows.
Added help screen.
Included SAYCHK utility.
Posted on CompuServe.